import React, { useEffect, useState } from 'react';
import { Avatar, Col, Row, Typography } from 'antd';

function PlatformBasicInfo({userInfo}) {
  // const [userInfo, setUserInfo] = useState({});

  // useEffect(() => {
  //   const fetchData = async () => {
  //     const data = await getUserInfo();
  //     setUserInfo(data);
  //   };
  //   fetchData();
  // }, []);

  return (
    <>
      <Row>
        <Typography.Title className="base-info-bg" level={5}>
          基础信息
        </Typography.Title>
        {/*<Col span={3}>*/}
        {/*  <Avatar src={userInfo.avatarUrl} size={64} />*/}
        {/*</Col>*/}
        <Col span={7} className="base-info">
          <span>
            用户ID：<span>{userInfo.id}</span>
          </span>
          <span>
            用户名：<span>{userInfo.userName}</span>
          </span>
          <span>
            用户昵称：<span>{userInfo.nickName}</span>
          </span>
          <span>
            地址：<span>{userInfo.ipAddress}</span>
          </span>
          <span>
            注册时间：<span>{userInfo.regTime}</span>
          </span>
          <span>
            最后登录时间：<span>{userInfo.lastLoginTime}</span>
          </span>
          <span>
            职业：<span>{userInfo.introduction}</span>
          </span>
          <span>
            手机号：<span>{userInfo.phone}</span>
          </span>
          <span>
            用户来源：<span>{userInfo.providerType}</span>
          </span>
          <span>
            账户状态：<span>{userInfo.status}</span>
          </span>
        </Col>
      {/* </Row>
      <Typography.Title className="base-info-bg" level={5}>
        基础信息
      </Typography.Title>
      <Row>
        <Col span={7} className="base-info">
          <span>
            真实姓名：<span>{userInfo.realName}</span>
          </span>
          <span style={{ marginBottom: 12 }}>
            联系方式：<span>{userInfo.phone}</span>
          </span>
          <span>
            婚姻：<span>{userInfo.maritalStatus}</span>
          </span>
        </Col>
        <Col span={10} className="base-info">
          <span>
            性别：<span>{userInfo.gender}</span>
          </span>
          <span style={{ marginBottom: 12 }}>
            常用地址：<span>{userInfo.address}</span>
          </span>
          <span>
            邮箱：<span>{userInfo.email}</span>
          </span>
        </Col>
        <Col span={7} className="base-info">
          <span>
            生日：<span>{userInfo.birthday}</span>
          </span>
          <span>
            职业：<span>{userInfo.occupation}</span>
          </span>
        </Col>
      </Row>
      <Typography.Title className="base-info-bg" level={5}>
        平台属性
      </Typography.Title>
      <Row>
        <Col span={7} className="base-info">
          <span>
            注册日期：<span>{userInfo.regDate}</span>
          </span>
          <span>
            激活日期：<span>{userInfo.activeDate}</span>
          </span>
        </Col>
        <Col span={10} className="base-info">
          <span>
            最近登录时间：<span>{userInfo.lastLoginTime}</span>
          </span>
          <span>
            用户来源：<span>{userInfo.source}</span>
          </span>
        </Col> */}
      </Row>
    </>
  );
}

export default PlatformBasicInfo;
